package org.yefei.homeworkday16.carrentsysem;

import java.util.Scanner;

public class TestCarCompany {
	public static void main(String[] args) {
		int ch;
		Scanner in = new Scanner(System.in);
		CarCompany com = new CarCompany("大富豪汽车租赁有限公司", 88888888);
		com.showCom();
		while (true) {
			System.out.println("1：查看车辆情况，2：租赁，3：还车，4：报废，5：采购新车，6：查看租赁记录，9：退出");
			ch = in.nextInt();
			if (ch == 1) {
				com.showInfo();
			} else if (ch == 2) {
				System.out.print("请输入要租赁的类型（轿车/客车）：");
				String l = in.next();
				com.showLeaseObj(l);
				System.out.println("请输入要租赁的车的车牌号：");
				String c = in.next();
				boolean b = com.chooseCnum(c);
				if (b) {
					System.out.println("请输入要租赁的天数：");
					int day = in.nextInt();
					com.getCar(day);
				} else {
					System.out.println("车辆已被出租！");
				}
			} else if (ch == 3) {
				System.out.println("请输入还车的车牌号");
				String a = in.next();
				boolean c = com.reback(a);
				if (c) {
					System.out.println("还车成功，感谢使用！");
				} else {
					System.out.println("请核对车辆信息是否正确！");
				}
			} else if (ch == 4) {
				System.out.println("输入要报废的车辆车牌号：");
				com.scrap(in.next());
			} else if (ch == 5) {
				System.out.println("新增车辆类型：");
				String next = in.next();
				if (next.equals("客车")) {
					System.out.println("依次输入汽车的品牌，车牌号，日租金，状态，座位数，类型");
					com.addCar(new Coach(in.next(), in.next(), in.nextDouble(), in.nextBoolean(), in.nextInt(),
							in.next()));
				} else if (next.equals("轿车")) {
					System.out.println("依次输入汽车的品牌，车牌号，日租金，状态，座位数，类型");
					com.addCar(new Limousine(in.next(), in.next(), in.nextDouble(), in.nextBoolean(), in.nextInt(),
							in.next()));
				}

			} else if (ch == 6) {

			} else if (ch == 9) {
				System.out.println("欢迎下次再来！");
				break;
			}
		}
	}
}
